<%-- 
    Document   : risultatoRicerca
    Created on : 9-ago-2010, 15.33.04
    Author     : edoardo
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	try {
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>


<table width="100%" style="font-family: sans-serif; font-size: 12">
	<tr style="border-bottom: thin">
		<td>ID TICKET</td>
		<td><c:out value="${ticket.idTicket}" /></td>
	</tr>
	<tr style="border-bottom: thin">
		<td>TITOLO</td>
		<td><c:out value="${ticket.titoloTicket}" /></td>
	</tr>
	<tr style="border-bottom: thin">
		<td>DESCRIZIONE</td>
		<td><c:out value="${lastStorico.descrizione}" /></td>
	</tr>
	<c:if test="${lastStorico.prossimaAzione!=nul}">
		<tr style="border-bottom: thin">
			<td>PROSSIMA AZIONE</td>
			<td><c:out value="${lastStorico.prossimaAzione}" /></td>
		</tr>
	</c:if>

	<tr style="border-bottom: thin">
		<td>DATA INSERIMENTO</td>
		<td><fmt:formatDate pattern="dd/MM/yyyy" value="${ticket.dataInserimento}" /></td>
	</tr>
	<tr style="border-bottom: thin">
		<td>STATO</td>
		<td><c:out value="${ticket.stati.descrizione}" /></td>
	</tr>
	<tr style="border-bottom: thin">
		<td>DATA ULTIMA MODIFICA</td>
		<td><fmt:formatDate pattern="dd/MM/yyyy" value="${ticket.dataUltimaModifica}" /></td>
	</tr>
	<tr style="border-bottom: thin">
		<td>UTENTE</td>
		<td><c:out value="${ticket.utentiByIdUtente.cognome}" /> <c:out
			value="${ticket.utentiByIdUtente.nome}" /></td>
	</tr>
	<tr style="border-bottom: thin">
		<td>ASSEGNATO A</td>
		<c:choose>
			<c:when test="${ticket.utentiByIdOwner!=null}">
				<td><c:out value="${ticket.utentiByIdOwner.cognome}" /> <c:out
					value="${ticket.utentiByIdOwner.nome}" /></td>
			</c:when>
			<c:otherwise>
				<td>NON ASSEGNATO</td>
			</c:otherwise>
		</c:choose>
	</tr>
	<tr style="border-bottom: thin">
		<td>UTENTE ULTIMA MODIFICA</td>
			<c:if test="${ticket.utentiByIdUtenteUltimaModifica!=null}">
				<td><c:out
					value="${ticket.utentiByIdUtenteUltimaModifica.cognome}" /> <c:out
					value="${ticket.utentiByIdUtenteUltimaModifica.nome}" /></td>
			</c:if>
			
	</tr>

</table>
<p></p>
<c:if test="${not empty storico }">
	<table width="100%" style="font-family: sans-serif; font-size: 12; border-color: black; border-bottom: thin; border-left: thin; border-right: thin; border-top: thin;" >
		<tr>
			<td>Data modifica</td>
			<td>Ora modifica</td>
			<td>Descrizione</td>
		</tr>
		<c:forEach items="${storico}" var="item">
			<c:choose>
				<c:when test="${item.prossimaAzione==null }">
					<tr>
						<td width="10%"><fmt:formatDate value="${item.dataModifica }"
							pattern="dd/MM/yyyy" /></td>
						<td width="10%"><fmt:formatDate value="${item.dataModifica }"
							pattern="HH:mm" /></td>
						<td width="80%"><c:out value="${item.descrizione}"></c:out></td>
					</tr>
				</c:when>
				<c:otherwise>
					<tr>
						<td width="10%"><fmt:formatDate value="${item.dataModifica }"
							pattern="dd/MM/yyyy" /></td>
						<td width="10%"><fmt:formatDate value="${item.dataModifica }"
							pattern="HH:mm" /></td>
						<td width="80%"><c:out value="${item.prossimaAzione}"></c:out></td>
					</tr>
				</c:otherwise>
			</c:choose>
		</c:forEach>
	</table>
</c:if>
</body>
</html>
<%
	} catch (Exception e) {
		e.printStackTrace();
	}
%>
